package edu.neusoft.springhtmldemo.mapper;

import edu.neusoft.springhtmldemo.domain.OperatingLog;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface OperatingLogMapper {
    @Select("SELECT ope.oid, uen.userName,opn.operateDetail,ope.alarmBeginTime\n" +
            "from operatinglogentity ope, operatingtypeenum opn, usermanagemententity uen\n" +
            "where ope.operateNum=opn.operateNum\n" +
            "and ope.userId=uen.userId")
    List<OperatingLog> selectAll();

    @Select("SELECT ope.oid, uen.userName,opn.operateDetail,ope.alarmBeginTime\n" +
            "from operatinglogentity ope, operatingtypeenum opn, usermanagemententity uen\n" +
            "where ope.operateNum=opn.operateNum\n" +
            "and ope.userId=uen.userId\n" +
            "and ope.oid like '%' #{oid} '%'\n" +
            "and uen.userName like '%' #{userName} '%'\n" +
            "and opn.operateDetail like '%' #{operateDetail} '%'\n" +
            "and ope.alarmBeginTime like '%' #{alarmBeginTime} '%'")
    List<OperatingLog> selectOperatingLog(String oid, String userName, String operateDetail, String alarmBeginTime);
}
